package com.copm.ifm.servers.sys.controller;

import com.copm.ifm.base.basic.ServiceResponse;
import com.copm.ifm.base.basic.pojo.SysExceptionLog;
import com.copm.ifm.base.service.base.BaseController;
import com.copm.ifm.servers.sys.client.SysExceptionLogClient;
import com.copm.ifm.servers.sys.service.SysExceptionLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 系统异常日志表相关接口类
 *
 * @author tp
 * @date 2020/12/15 11:39
 */
@Slf4j
@Api(tags = "系统异常日志/sys-exception-log")
@RestController
@RequestMapping("/sys-exception-log")
public class SysExceptionLogController extends BaseController implements SysExceptionLogClient {

    @Resource
    SysExceptionLogService service;

    @Override
    @ApiOperation("保存")
    @PostMapping
    public ServiceResponse<SysExceptionLog> save(@RequestBody SysExceptionLog entity) {
        service.save(entity);
        return success(entity);
    }
}
